﻿using UnityEngine;
using System.Collections;

public class IndexHold : MonoBehaviour {

	public int numberIndex;
	public NewGameController2048 myGameController;
	//动画组件
	public Animation myAnimation;
	//如果这个块是和上一块相加得到的,他就不移动而是直接赋值Vector3.zero
	public bool isCubeMove = false;

	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () {
	
	}

	public void ChangNumber()
	{
		numberIndex += 1;
		this.name = myGameController.myNumbers[numberIndex].name+"(Clone)";
		this.GetComponent<SpriteRenderer>().sprite = myGameController.myNumbers[numberIndex].GetComponent<SpriteRenderer>().sprite;
		myAnimation.CrossFade("TwoNumberAdd");
		isCubeMove = true;
	}
}
